/**
 * Created by JetBrains WebStorm.
 * User: dimas
 * Date: 16.09.11
 * Time: 22:57
 * To change this template use File | Settings | File Templates.
 */
Array.prototype.toJsonString = function() {
    return '[' + Object.keys(this).toString() + ']';
}

Object.prototype.toJson = function(){
    var type = this.constructor.name;
    switch(typeof this){
        case "object":
            return this.toJson()
        case "Number":
            return this
        case "String":
            return this.toString()
    }
}


Object.prototype.instanceOf = function(t){return this.constructor == t; }